﻿
<%@ Page Language="C#" AutoEventWireup="false" MasterPageFile="/templates/masterpages/default.master" CodeBehind="Gallery.aspx.cs" Inherits="EPiServer.Municipality.Templates.Pages.Gallery" %>
<%@ Register TagPrefix="EPiServer" TagName="LocalNavigation" src="~/Templates/Units/LocalNavigation.ascx" %>
<%@ Register TagPrefix="EPiServer" TagName="MainImage" src="~/Templates/Units/MainImage.ascx" %>
<%@ Register TagPrefix="EPiServer" TagName="Comment" src="~/Templates/Units/Comment.ascx" %>
<%@ Register TagPrefix="EPiServer" TagName="Share" src="~/Templates/Units/Share.ascx" %>
<%@ Register TagPrefix="EPiServer" TagName="PageInfo" src="~/Templates/Units/PageInfo.ascx" %>
<asp:content runat="server" contentplaceholderid="Content">
    <div id="local-nav">
        <EPiServer:LocalNavigation runat="server" />
    </div>
    <div class="main">
        <EPiServer:Hn PropertyName="Heading" DisplayMissingMessage="false" runat="server" />
        <EPiServer:MainImage runat="server" />
        <EPiServer:Property PropertyName="MainBody" runat="server" DisplayMissingMessage="false" EnableViewState="false" />
        <div id="scope-bar">
            <form action="<%=Request.Url.PathAndQuery %>" method="post">
                <div>
                    <div>
                        <strong><EPiServer:Translate Text="/municipality/templates/gallery/categories" runat="server" /></strong>
                        <asp:Literal ID="CategoryControl" runat="server" />
                    </div>
                    <label for="image-search" class="structural"><EPiServer:Translate Text="/municipality/templates/gallery/searchlabel" runat="server" /></label>
                    <input type="text" id="image-search" class="text" name="query" value="<%=Request.QueryString["q"] %>" />
                    <input type="submit" value="<%=Translate("/municipality/templates/gallery/searchbutton") %>" class="button" />
                </div>
            </form>
            <asp:PlaceHolder runat="server" id="UploadAction" visible="false">
                <a href="#" id="upload-link"><EPiServer:Translate runat="server" text="/municipality/templates/gallery/uploadlink" /></a>
            </asp:PlaceHolder>
        </div>
        <ImageVault:IVAlbumTree AlbumProperty="AlbumRoot" runat="server" ID="AlbumControl" NumberOfLevels="1" visible="false">
            <HeaderTemplate>
                <ul id="albums">
            </HeaderTemplate>
            <ItemTemplate>
                <li>
                    <a href="<%#EPiServer.UriSupport.AddQueryString(CurrentPage.LinkURL, "album", Container.CurrentAlbum.Id.ToString())%>">
                        <img src="<%#GetAlbumCover(Container.CurrentAlbum)%>" alt="<%#Container.CurrentAlbum.Name %>" />
                    </a>
                    <a href="<%#EPiServer.UriSupport.AddQueryString(CurrentPage.LinkURL, "album", Container.CurrentAlbum.Id.ToString())%>" class="album-link">
                        <%#Container.CurrentAlbum.Name %> (<%#Container.CurrentAlbum.NrOfFiles %>)
                    </a>
                </li>
            </ItemTemplate>
            <FooterTemplate>
                </ul>
            </FooterTemplate>
        </ImageVault:IVAlbumTree>

        <EPiServer:IVPagedFileList runat="server" id="GalleryControl" enableviewstate="false" PageSize="<%#NrOfFiles %>" visible="false">
            <HeaderTemplate>
                <ul id="images">
            </HeaderTemplate>
            <ItemTemplate>
                <li>
                    <a href="<%#GetPreviewUrl(Container.CurrentFile) %>">
                        <ImageVault:IVImage runat="server" ImageFormat="png" ImageWidth="130" ImageHeight="130" AspectRatio="1.25" />
                    </a>
                    <div class="metadata">
                        <ImageVault:IVMetaDataList runat="server">
                            <headertemplate>
                                <ul>
                            </headertemplate>
                            <itemtemplate>
                                <li>
                                    <strong><%#Container.CurrentMetaData.Name%></strong>: <%#Container.CurrentMetaData.Value%>
                                </li>
                            </itemtemplate>
                            <footertemplate>
                                </ul>    
                            </footertemplate>
                        </ImageVault:IVMetaDataList>
                        <ul class="conversions">
                            <ImageVault:IVConversionFormatList runat="server">
                                <itemtemplate>
                                    <li>
                                        <span> 
                                            <a href='<%#GetDownloadLinkUrl(Container.CurrentFormat)%>'>
                                                <%#Container.CurrentFormat.Name%><br />
                                                <em>(<%#Container.CurrentFormat.Width%> x <%#Container.CurrentFormat.Height%>)</em>
                                            </a>
                                        </span>
                                    </li>
                                </itemtemplate>
                            </ImageVault:IVConversionFormatList>
                        </ul>
                    </div>
                </li>
            </ItemTemplate>
            <FooterTemplate>
                </ul>
            </FooterTemplate>
        </EPiServer:IVPagedFileList>

        <EPiServer:Comment runat="server" />
        <EPiServer:Share runat="server" />
        <div id="page-info">
            <EPiServer:PageInfo runat="server" />
        </div>
    </div>
</asp:content>